using CxRomos.Core.Domain.Entities;
using StructureMap;

namespace CxRomos.Core.Services.Implementation {
    [Pluggable("Default")]
    public class UserSession : IUserSession {
        private readonly IWebContext _webContext;

        public UserSession() {
            _webContext = ObjectFactory.GetInstance<IWebContext>();
        }

        public bool LoggedIn {
            get {
                return _webContext.LoggedIn;
            }
            set {
                _webContext.LoggedIn = value;
            }
        }

        public Account CurrentUser {
            get {
                return _webContext.CurrentUser;
            }
            set {
                _webContext.CurrentUser = value;
            }
        }

        public string Username {
            get {
                return _webContext.Username;
            }

            set {
                _webContext.Username = value;
            }
        }

    }
}